package com.bit.springiocdemo.controller;

import com.bit.springiocdemo.config.DataSourceConfig;
import com.bit.springiocdemo.model.Dbtypes;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/yml")
public class YmlController {
    @Value("${key}")
    private String key;
    @Value("${spring.datasource.url}")
    private String url;

    @Autowired
    private DataSourceConfig config;

    @Autowired
    private Dbtypes dbtypes;


    @RequestMapping("/readValue")
    public String readValue() {
        System.out.println("key:" + key);
        System.out.println("url:" + url);
        System.out.println(config);
        System.out.println(dbtypes);
        return "key:" + key + ", url:" + url;
    }
}
